package com.client.mapper;

import com.client.dto.GoodsAndLanguageDto;
import com.client.pojo.FlowerShopping;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 晚云
 * @since 2023-09-12
 */
@Mapper
public interface FlowerShoppingMapper extends BaseMapper<FlowerShopping> {

    List<FlowerShopping> selectByUserId(@Param("userId") String userId);

    boolean deleteByGoodsId(@Param("goodsId") String goodsId,@Param("userId") String userId);

    boolean deleteByUserIdAndGoodsId(@Param("shoppings") List<FlowerShopping> shoppings);

    boolean joinShopping(@Param("dto") GoodsAndLanguageDto goodsAndLanguageDto);

    FlowerShopping selectByGoodsIdAndUserId(@Param("goodsId") String goodsId,@Param("userId") String userId,@Param("goodsSpec") String goodsSpec);

    boolean updateByCountAndPrice(@Param("flowerShopping") FlowerShopping flowerShopping);
}
